package com.zuo.learn;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class CrimeFragment extends Fragment {

    // static field
    private static final String TAG = "F_PANG";

    // non static field
    private Crime mCrime;

    /**
     * 注意Fragment的onCreate是公共方法, 而Activity的onCreate方法是受保护的方法
     * Fragment的onCreate方法以及他的生命周期方法必须是公共的
     * 因为托管fragment的activity要调用它们
     *
     * Fragment视图并没有在Fragment.onCreate方法中生成.
     * 虽然在该方法中配置了fragment实例, 但创建和配置fragment视图是另一个
     * Fragment生命周期方法完成的 {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}
     * @param savedInstanceState
     */
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mCrime = new Crime();
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater,
                             @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState);
    }
}
